//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Policy Injection Application Block
//===============================================================================

using System;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration;

namespace EntLibContrib.PolicyInjection.Configuration
{
	/// <summary>
	/// Composite Matching Rule Data
	/// </summary>
	public abstract class CompositeMatchingRuleData : MatchingRuleData
	{
		#region Constants
		private const string MatchingRulesPropertyName = "matchingRules";
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the matching rules.
		/// </summary>
		/// <value>The matching rules.</value>
		[ConfigurationProperty(MatchingRulesPropertyName, IsDefaultCollection = true)]
		public NameTypeConfigurationElementCollection<MatchingRuleData, CustomMatchingRuleData> MatchingRules
		{
			get { return (NameTypeConfigurationElementCollection<MatchingRuleData, CustomMatchingRuleData>)base[MatchingRulesPropertyName]; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="CompositeMatchingRuleData"/> class.
		/// </summary>
		protected CompositeMatchingRuleData()
			: base()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="CompositeMatchingRuleData"/> class.
		/// </summary>
		/// <param name="matchingRuleName">Name of the rule in config.</param>
		/// <param name="matchingRuleType">The underlying type of matching rule this object configures.</param>
		protected CompositeMatchingRuleData(string matchingRuleName, Type matchingRuleType)
			: base(matchingRuleName, matchingRuleType)
		{
		}
		#endregion
	}
}
